<%= error_messages_for 'post' %>
<%= error_messages_for 'photo' %>

<h1>New photo</h1>

<% form_for :post, @post,
			:url => { :action => 'create' },
			:html => { :multipart => true }  do |form| %>
  
	<h3>Photos:</h3>
	<% fields_for :photo, @photo do |photo_fields| %>
		<p><label for="photo_file">Choose file to upload</label><br />
		<%= photo_fields.file_field 'uploaded_photo' %></p>

		<p><label for="title">title</label><br/>
		<%= photo_fields.text_field 'title' %></p>

		<p><label for="tags">Tags</label><br/>
		<%= photo_fields.text_field 'tags' %></p>

		<p><label for="pick">Pick?</label><br/>
		<%= photo_fields.check_box 'pick' %></p>
	<% end %>
	
	<h3>Post:</h3>
	<p><label for="name">Name</label><br/>
	<%= form.text_field 'name' %></p>

	<p><label for="is_showing">Showing?</label><br/>
	<%= form.check_box 'is_showing' %></p>

	<p><label for="post_description">Description</label><br/>
	<%= form.text_area 'description' %></p>

  <%= submit_tag "Create" %>
<% end %>

<%= link_to 'Back', :action => 'list' %>
